<template>
  <el-drawer
    v-model="submit_box"
    direction="rtl"
    size="80%"
    :close-on-click-modal="false"
    destroy-on-close
    @close="resetForm(addSubmitDataForm)"
    @open="open"
  >
    <template #title><h4>资料提交</h4></template>
    <template #default>
      <el-form
        :model="submit_form_data"
        :rules="rules"
        ref="addSubmitDataForm"
        label-width="150"
      >
        <div class="flex">
          <el-form-item label="项目名称" prop="name">
            <el-input
              v-model="submit_form_data.name"
              placeholder="请输入"
              disabled
              show-word-limit
              maxlength="100"
            ></el-input>
          </el-form-item>
          <el-form-item label="项目代号" prop="code">
            <el-input
              v-model="submit_form_data.code"
              placeholder="请输入"
              disabled
              show-word-limit
              maxlength="100"
            ></el-input>
          </el-form-item>
          <el-form-item label="下单面积" prop="orderArea">
            <el-input
              v-model="submit_form_data.orderArea"
              placeholder="请输入"
              type="number"
              show-word-limit
              maxlength="30"
              :disabled="item_form_data.status != 1"
            ></el-input>
          </el-form-item>
          <el-form-item label="单价" prop="price">
            <el-input
              v-model="submit_form_data.price"
              placeholder="请输入"
              type="number"
              show-word-limit
              maxlength="30"
              :disabled="item_form_data.status != 1"
            ></el-input>
          </el-form-item>
        </div>
        <div class="flex">
          <el-form-item label="提交类型" prop="type">
            <el-select
              v-model="submit_form_data.type"
              placeholder="请输入"
              :disabled="item_form_data.status == 1"
              @change="change_submitType"
            >
              <el-option
                v-for="item in type_list"
                :key="item.value"
                :value="item.value + ''"
                :label="item.label"
                :disabled="item_form_data.status != 1 && item.value == 1"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="变更记录"
            prop="changeId"
            v-if="submit_form_data.type != '1'"
          >
            <el-select
              v-model="submit_form_data.changeId"
              placeholder="请输入"
              @change="change_changeId"
            >
              <el-option
                v-for="item in requireChange_list.filter((i) => {
                  return i.type == submit_form_data.type;
                })"
                :key="item.id"
                :value="item.id"
                :label="item.code"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="总错误率(‰)"
            v-if="['2', '4'].includes(submit_form_data.type)"
          >
            <div class="flex">
              <el-input
                v-model="submit_form_data.wrongRate"
                placeholder="请输入"
                disabled
              ></el-input>
              <el-button class="m_left10" @click="show_submit_list_box = true"
                >计算公式</el-button
              >
            </div>
          </el-form-item>
        </div>
        <div class="flex" v-if="submit_form_data.type != 1">
          <el-form-item label="变更代号">
            <el-input v-model="submit_form_data.changeCode" placeholder="请输入" disabled>
            </el-input>
          </el-form-item>
          <el-form-item label="变更类型">
            <el-select
              v-model="submit_form_data.changeType"
              placeholder="请输入"
              disabled
            >
              <el-option
                v-for="item in changeType_list"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="变更原因">
            <el-select
              v-model="submit_form_data.changeReason"
              v-if="submit_form_data.type == 2"
              disabled
            >
              <el-option
                v-for="item in reason1_list"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
            <el-select
              v-model="submit_form_data.changeReason"
              v-if="submit_form_data.type == 3"
              disabled
            >
              <el-option
                v-for="item in reason2_list"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
            <el-select
              v-model="submit_form_data.changeReason"
              v-if="submit_form_data.type == 4"
              disabled
            >
              <el-option
                v-for="item in reason3_list"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
        </div>
        <div>
          <div class="fw"><span style="color: #f56c6c">*</span> 提交物料信息</div>
          <el-table :data="taskOrderDetailAddVOList_table_data" border class="m_top10">
            <el-table-column label="序号" type="index"></el-table-column>
            <el-table-column label="材料类别">
              <template #default="scope">
                <el-select
                  v-model="scope.row.materialType"
                  class="m_0_5"
                  style="width: 100px"
                  @change="
                    (e) => {
                      has_type_list[scope.$index] = e;
                    }
                  "
                >
                  <el-option
                    v-for="item in table_type_list"
                    :key="item.value"
                    :disabled="has_type_list.includes(item.value)"
                    :value="item.value"
                    :label="item.label"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="新增补料标准件件数(件)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.newStandardNum"
                  type="number"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="新增补料标准件面积/长度(m²/m)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.newStandardAreaLength"
                  type="number"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="新增补料非标件件数(件)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.newNoStandardNum"
                  type="number"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="新增补料非标件面积/长度(m²/m)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.newNoStandardAreaLength"
                  type="number"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="取消标准件件数(件)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.cancelStandardNum"
                  type="number"
                  :disabled="submit_form_data.type == 1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="取消标准件面积/长度(m²/m)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.cancelStandardAreaLength"
                  type="number"
                  :disabled="submit_form_data.type == 1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="取消非标件件数(件)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.cancelNoStandardNum"
                  type="number"
                  :disabled="submit_form_data.type == 1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="取消非标件面积/长度(m²/m)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.cancelNoStandardAreaLength"
                  type="number"
                  :disabled="submit_form_data.type == 1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="原件改制件数(件)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.originalChangeNum"
                  type="number"
                  :disabled="submit_form_data.type == 1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="原件改制面积/长度(m²/m)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.originalChangeAreaLength"
                  type="number"
                  :disabled="submit_form_data.type == 1"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="操作"
              ><template #default="scope">
                <el-button
                  v-if="scope.$index != 0"
                  @click="
                    taskOrderDetailAddVOList_table_data.splice(scope.$index, 1),
                      has_type_list.splice(scope.$index, 1)
                  "
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
          <el-button
            type="primary"
            class="m_top10"
            v-if="taskOrderDetailAddVOList_table_data.length < 5"
            @click="
              taskOrderDetailAddVOList_table_data.push(
                JSON.parse(JSON.stringify(taskOrderDetailAddVOList_table_item))
              ),
                has_type_list.push('')
            "
            >追加行</el-button
          >
        </div>
        <div v-if="submit_form_data.type == 4">
          <div class="fw m_top10">返工物料信息</div>
          <el-table :data="sceneReworkVOList_table_data" border class="m_top10">
            <el-table-column label="序号" type="index"></el-table-column>
            <el-table-column label="设计人员">
              <template #default="scope">
                <el-select
                  v-model="scope.row.memberId"
                  class="m_0_5"
                  style="width: 100px"
                >
                  <el-option
                    v-for="item in member_list"
                    :key="item.memberId"
                    :value="item.memberId"
                    :label="item.name"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="材料类型">
              <template #default="scope">
                <el-select
                  v-model="scope.row.materialType"
                  class="m_0_5"
                  style="width: 100px"
                >
                  <el-option
                    v-for="item in table_type_list"
                    :key="item.value"
                    :value="item.value"
                    :label="item.label"
                  ></el-option>
                </el-select>
              </template>
            </el-table-column>
            <el-table-column label="返工件数(件)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.reworkNum"
                  type="number"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="返工面积/长度(m²/m)"
              ><template #default="scope">
                <el-input
                  class="m_0_5"
                  style="width: 100px"
                  v-model="scope.row.reworkAreaLength"
                  type="number"
                ></el-input> </template
            ></el-table-column>
            <el-table-column label="操作"
              ><template #default="scope">
                <el-button @click="sceneReworkVOList_table_data.splice(scope.$index, 1)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
          <el-button
            type="primary"
            class="m_top10"
            v-if="sceneReworkVOList_table_data.length < 5"
            @click="
              sceneReworkVOList_table_data.push(
                JSON.parse(JSON.stringify(sceneReworkVOList_table_item))
              )
            "
            >追加行</el-button
          >
        </div>

        <div>
          <div class="flex">
            <el-form-item label="新增总件数">
              <el-input
                v-model="submit_form_data.addNum"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
            <el-form-item label="新增总面积/长度">
              <el-input
                v-model="submit_form_data.addAreaLength"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
          </div>
          <div class="flex">
            <el-form-item label="取消总件数">
              <el-input
                v-model="submit_form_data.cancelNum"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
            <el-form-item label="取消总面积/长度">
              <el-input
                v-model="submit_form_data.cancelAreaLength"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
          </div>
          <div class="flex">
            <el-form-item label="原件改制总件数">
              <el-input
                v-model="submit_form_data.reformNum"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
            <el-form-item label="原件改制总面积/长度">
              <el-input
                v-model="submit_form_data.reformAreaLength"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
          </div>
        </div>
        <!-- <div v-else>
          <div class="flex">
            <el-form-item label="返工总件数">
              <el-input
                v-model="submit_form_data.addNum"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
            <el-form-item label="返工总面积/长度">
              <el-input
                v-model="submit_form_data.addAreaLength"
                placeholder="请输入"
                disabled
              ></el-input>
            </el-form-item>
          </div>
        </div> -->
        <el-form-item label="提交文件">
          <taskFile :item_form_data="item_form_data" :isAdd="true" :type="2"></taskFile>
        </el-form-item>
        <el-form-item label="备注">
          <el-input
            v-model="submit_form_data.remark"
            placeholder="请输入"
            type="textarea"
          ></el-input>
        </el-form-item>
        <div class="tr m_top10">
          <el-button class="m_left10" @click="show_submit_list_box = true"
            >提交记录</el-button
          >
          <el-button @click="resetForm(addSubmitDataForm)">取消</el-button>
          <el-button type="primary" @click="submit(addSubmitDataForm)">确定</el-button>
        </div>
      </el-form>
    </template>
  </el-drawer>
  <submitList
    :show_submit_list_box="show_submit_list_box"
    :item_form_data="item_form_data"
    :member_list="member_list"
    @close="show_submit_list_box = false"
  ></submitList>
</template>

<script lang="ts" setup>
import { ref, toRefs, watch, computed } from "vue";
import axios from "@/service/HttpRequest";
import taskFile from "./taskFile.vue";
import serviceApi from "@/service/api";
import EventBus from "@/utils/EventBus";
import submitList from "./submitList.vue";
import { ElMessage, ElMessageBox, FormInstance } from "element-plus";
import { useStore } from "vuex";
const store = useStore();
const props = defineProps({
  submit_box: Boolean,
  item_form_data: Object,
  member_list: Array,
});

const reason1_list = ref([
  { value: 1, label: "布排错误" },
  { value: 2, label: "深化错误" },
  { value: 3, label: "其他变更" },
]);
const reason2_list = ref([
  { value: 1, label: "客户变更" },
  { value: 2, label: "3层以上补料" },
  { value: 3, label: "其他变更" },
]);
const reason3_list = ref([
  { value: 1, label: "现场少料" },
  { value: 2, label: "生产错误" },
  { value: 3, label: "质量问题" },
]);
const changeType_list = ref([
  { value: "1", label: "客户结构优化补板" },
  { value: "2", label: "客户损坏补板" },
  { value: "3", label: "客户增加辅料" },
  { value: "4", label: "客户增加铁配件" },
  { value: "5", label: "客户楼栋周转" },
  { value: "6", label: "客户增加加固件" },
  { value: "7", label: "深化结构错误" },
  { value: "8", label: "深化配件遗漏" },
  { value: "9", label: "深化做法未明确" },
  { value: "10", label: "深化三维和底图不符" },
  { value: "11", label: "配模碰撞和漏配" },
  { value: "12", label: "配模加工图错误" },
  { value: "13", label: "铁配件算错" },
  { value: "14", label: "清单错误" },
  { value: "15", label: "拼装图错误" },
  { value: "16", label: "配模结构配错" },
]);
const show_submit_list_box = ref(false);
const addSubmitDataForm = ref<FormInstance>();
const rules = ref({
  orderArea: [{ required: true, message: "请输入面积", trigger: "blur" }],
  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
  type: [{ required: true, message: "请选择提交类型", trigger: "change" }],
  changeId: [{ required: true, message: "请选择变更记录", trigger: "change" }],
});
// 1铝件 2铁件 3背楞 4辅料 5铁配件
const table_type_list = ref([
  { value: 1, label: "铝件" },
  { value: 2, label: "铁件" },
  { value: 3, label: "背楞" },
  { value: 4, label: "辅料" },
  { value: 5, label: "铁配件" },
]);
const type_list = ref([
  { value: 1, label: "首次下单" },
  { value: 2, label: "设计变更" },
  { value: 3, label: "需求变更" },
  { value: 4, label: "现场返工" },
]);
const has_type_list = ref([]);
const uploadFile = ref();
EventBus.on("uploadFile", (e: any) => {
  //   console.log(e);
  uploadFile.value = e[0];
});
const { item_form_data, member_list, submit_box } = toRefs<any>(props);
const taskOrderDetailAddVOList_table_item = {
  materialType: "",
  newNoStandardAreaLength: "",
  newNoStandardNum: "",
  newStandardAreaLength: "",
  newStandardNum: "",
  cancelNoStandardAreaLength: "",
  cancelNoStandardNum: "",
  cancelStandardAreaLength: "",
  cancelStandardNum: "",
  originalChangeAreaLength: "",
  originalChangeNum: "",
  taskOrderId: item_form_data.value.id,
};
const sceneReworkVOList_table_item = ref({
  memberId: "",
  reworkNum: "",
  reworkAreaLength: "",
  materialType: "",
});
const taskOrderDetailAddVOList_table_data = ref([]); // 非返工物料信息
const sceneReworkVOList_table_data = ref([]); // 返工物料信息
const change_submitType = (e) => {
  console.log(e);
  if (e != 4) {
    sceneReworkVOList_table_data.value = [];
  }
};
const open = () => {
  get_submit_list();
  taskOrderDetailAddVOList_table_data.value = [];
  sceneReworkVOList_table_data.value = [];
  has_type_list.value = [];
  taskOrderDetailAddVOList_table_data.value.push(
    JSON.parse(JSON.stringify(taskOrderDetailAddVOList_table_item))
  );
  has_type_list.value.push("");
  addNum.value = 0;
  addAreaLength.value = 0;
  cancelNum.value = 0;
  cancelAreaLength.value = 0;
  reformNum.value = 0;
  reformAreaLength.value = 0;
  wrongRate.value = "";
  submit_form_data.value.name = item_form_data.value.name;
  submit_form_data.value.code = item_form_data.value.code;
  submit_form_data.value.taskId = item_form_data.value.id;
  submit_form_data.value.type = item_form_data.value.status == 1 ? "1" : "2";
  submit_form_data.value.orderArea = item_form_data.value.area;
  submit_form_data.value.price = item_form_data.value.price;
  console.log(submit_form_data.value);
  get_requireChange_list();
  //   get_task_list();
};

const addNum = ref<number>(0); // 新增 数量 面积
const addAreaLength = ref<number>(0);
const cancelNum = ref<number>(0); // 取消 数量 面积
const cancelAreaLength = ref<number>(0);
const reformNum = ref<number>(0); // 改件 数量 面积
const reformAreaLength = ref<number>(0);
const wrongRate = ref(""); // 本次错误率
watch(
  taskOrderDetailAddVOList_table_data,
  (a, b) => {
    addNum.value = 0;
    addAreaLength.value = 0;
    cancelNum.value = 0;
    cancelAreaLength.value = 0;
    reformNum.value = 0;
    reformAreaLength.value = 0;
    wrongRate.value = "";
    a.forEach((i) => {
      addNum.value += Number(i.newStandardNum) + Number(i.newNoStandardNum);
      addAreaLength.value +=
        Number(i.newStandardAreaLength) + Number(i.newNoStandardAreaLength);
      cancelNum.value += Number(i.cancelStandardNum) + Number(i.cancelNoStandardNum);
      cancelAreaLength.value +=
        Number(i.cancelStandardAreaLength) + Number(i.cancelNoStandardAreaLength);
      reformNum.value += Number(i.originalChangeNum);
      reformAreaLength.value += Number(i.originalChangeAreaLength);
      console.log(submit_list.value.length);
      if (item_form_data.value.status != 1 && submit_list.value.length) {
        wrongRate.value = ((addNum.value / submit_list.value[0].addNum) * 1000).toFixed(
          2
        );
      }
    });
    console.log(wrongRate.value);
    // console.log(a, addNum.value, submit_list.value[0].addNum, wrongRate.value);
  },
  { deep: true }
);
const submit_form_data = ref<any>({
  name: "",
  code: "",
  taskId: "",
  type: "",
  changeId: "", // 需求id
  taskOrderDetailAddVOList: [],
  sceneReworkVOList: [],
  remark: "",
  orderArea: "",
  price: "",
  orderMemberId: store.state.user_info.id,
  wrongRate: computed(() => {
    return Number(wrongRate.value) + Number(history_wrongRate.value);
  }),
  addNum: computed(() => {
    return addNum.value.toFixed(2);
  }),
  addAreaLength: computed(() => {
    return addAreaLength.value.toFixed(2);
  }),
  cancelNum: computed(() => {
    return cancelNum.value.toFixed(2);
  }),
  cancelAreaLength: computed(() => {
    return cancelAreaLength.value.toFixed(2);
  }),
  reformNum: computed(() => {
    return reformNum.value.toFixed(2);
  }),
  reformAreaLength: computed(() => {
    return reformAreaLength.value.toFixed(2);
  }),
  changeReason: "",
  changeType: "",
  changeCode: "",
});
const change_changeId = (e) => {
  console.log(e);
  let item = requireChange_list.value.filter((i) => {
    return i.id == e;
  });
  submit_form_data.value.changeCode = item[0].code;
  submit_form_data.value.changeType = item[0].changeType + "";
  submit_form_data.value.changeReason =
    item[0].reason1 || item[0].reason2 || item[0].reason3;
};
const submit = async (formEl: FormInstance | undefined) => {
  await formEl.validate((valid) => {
    if (valid) {
      ElMessageBox.confirm("确定提交资料", "", {
        closeOnClickModal: false,
        type: "warning",
      })
        .then(() => {
          if (
            addNum.value == 0 &&
            addAreaLength.value == 0 &&
            cancelNum.value == 0 &&
            cancelAreaLength.value == 0 &&
            reformNum.value == 0 &&
            reformAreaLength.value == 0
          ) {
            ElMessage.error("请提交至少一条有效数据");
            return;
          }
          submit_form_data.value.taskOrderDetailAddVOList =
            taskOrderDetailAddVOList_table_data.value;
          submit_form_data.value.sceneReworkVOList = sceneReworkVOList_table_data.value;
          if (!["2", "4"].includes(submit_form_data.value.type)) {
            submit_form_data.value.wrongRate = computed(() => {
              return "";
            });
          }
          let fileList = [];
          (uploadFile.value as any).file_data.forEach((i) => {
            let obj = {
              fileConfigId: i.id,
              fileName: i.fileName.length ? i.fileName.toString() : "",
              fileUrl: i.url.length ? i.url.toString() : "",
            };
            fileList.push(obj);
          });
          let data = Object.assign(submit_form_data.value, {
            nodeConfigFileVOList: fileList,
          });
          console.log(data);
          axios
            .request({
              url: serviceApi.taskOrder,
              method: "post",
              data: data,
            })
            .then(() => {
              ElMessage.success("操作成功！");
              resetForm(formEl);
            })
            .catch((err) => {
              ElMessage.error(err);
            });
        })
        .catch(() => {});
    }
  });
};
// 通过的变更单列表
const requireChange_list = ref([]);
const get_requireChange_list = () => {
  axios
    .request({
      url: serviceApi.taskChange + "/list",
      method: "post",
      data: {
        taskId: item_form_data.value.id,
      },
    })
    .then((res) => {
      console.log(res);
      requireChange_list.value = res.data.filter((i) => {
        return i.status == 2;
      });
    })
    .catch((err) => {
      ElMessage.error(err);
    });
};
// 以往提交过的记录
const submit_list = ref([]);
const history_wrongRate = ref(0);
const get_submit_list = () => {
  axios
    .request({
      url: serviceApi.taskOrder + "/list",
      method: "post",
      data: { taskId: item_form_data.value.id },
    })
    .then((res) => {
      console.log(res.data);
      submit_list.value = res.data;
      let arr = res.data.filter((i) => {
        return i.wrongRate && i.wrongRate != "";
      });
      history_wrongRate.value = arr.at(-1) ? arr.at(-1).wrongRate : 0;
    })
    .catch((err) => {
      ElMessage.error(err);
    });
};
// 项目下任务列表
// const task_list = ref([]);
// const get_task_list = () => {
//   axios
//     .request({
//       url: serviceApi.assignTaskList + "/" + item_form_data.value.id,
//       method: "post",
//     })
//     .then((res) => {
//       console.log(res);
//       task_list.value = res.data.taskMemberList;
//     })
//     .catch((err) => {
//       ElMessage.error(err);
//     });
// };
const resetForm = (formEl: FormInstance | undefined) => {
  if (!formEl) return;
  formEl.resetFields();
  submit_form_data.value = {
    name: item_form_data.value.name,
    code: item_form_data.value.code,
    taskId: item_form_data.value.id,
    type: "",
    changeId: "",
    taskOrderDetailAddVOList: [],
    sceneReworkVOList: [],
    remark: "",
    orderArea: "",
    orderMemberId: submit_form_data.value.orderMemberId,
    price: "",
    wrongRate: computed(() => {
      return Number(wrongRate.value) + Number(history_wrongRate.value);
    }),
    addNum: computed(() => {
      return addNum.value.toFixed(2);
    }),
    addAreaLength: computed(() => {
      return addAreaLength.value.toFixed(2);
    }),
    cancelNum: computed(() => {
      return cancelNum.value.toFixed(2);
    }),
    cancelAreaLength: computed(() => {
      return cancelAreaLength.value.toFixed(2);
    }),
    reformNum: computed(() => {
      return reformNum.value.toFixed(2);
    }),
    reformAreaLength: computed(() => {
      return reformAreaLength.value.toFixed(2);
    }),
    changeReason: "",
    changeType: "",
    changeCode: "",
  };
  EventBus.emit("close_box");
};
</script>

<style lang="scss" scoped></style>
